package service;

import domain.Administrator;
import domain.Category;
import domain.PageBean;
import domain.User;

import java.util.Map;

public interface AdminService {
    /**
     * 管理员登录
     * @param admin
     * @return
     */
    Administrator login(Administrator admin);

    /**
     * 分页条件查询
     * @param currentPage
     * @param rows
     * @param condition
     * @return
     */
    PageBean findUserByPage(String currentPage, String rows, Map<String, String[]> condition);

    /**
     * 删除单个用户
     * @param uid
     */
    void deleteUser(String uid);


    /**
     * 多选删除用户
     * @param ids
     */
    void delSelectedUsersById(String[] ids);


    /**
     * 查询文章所有信息
     *
     * @param currentPage
     * @param rows
     * @return
     */
    PageBean findArticleByPage(String currentPage, String rows);

    User findUserByCode(String code);

    Category findCategory(int cid);

    int updateUsernameAndPassword(int id, String username, String password);

    void deleteCategory(String cid);

    PageBean findCategoryByPage(String currentPage, String rows, Map<String, String[]> condition);

    void addCategory(String cname);

    PageBean findLabelByPage(String currentPage, String rows, Map<String, String[]> condition);

    void deleteLabel(String lid);

    void addLabel(String lname);

    Administrator findOneAdmin(String username);
}
